// @ts-ignore

/* eslint-disable */
// import { request } from 'umi';
import request from '@/utils/request';
/** 获取当前的用户 GET /api/currentUser */

export async function currentUser(options) {
  return request('/api/currentUser', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 退出登录接口 POST /api/login/outLogin */
export async function outLogin(options) {
  return request('/api/login/outLogin', {
    method: 'POST',
    ...(options || {}),
  });
}
/** 获取当前的用户权限 get /api/User/GetPermission */
export async function getUserPermission(options) {
  return request('/api/User/GetPermission', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    ...(options || {}),
  });
}


export async function GetUserRoutes(params) {
  return request('/api/Menu/GetUserRoutes', {
    method: 'GET',
    params,
    headers: {
      'Content-Type': 'application/json',
    }
  });
}

// 获取租户信息
export async function getTenantInfoByCode(code) {
  return request('/api/Tenant/GetByCode?code=' + code, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
  });
}
/** 登录接口 POST /api/login/account */
export async function login(body, options) {
  return request('/api/Account/Login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
// export async function login(body, options) {
//   return request('/api/login/account', {
//     method: 'POST',
//     headers: {
//       'Content-Type': 'application/json',
//     },
//     data: body,
//     ...(options || {}),
//   });
// }
//
/** 此处后端没有提供注释 GET /api/notices */

export async function getNotices(options) {
  return request('/api/Notice/Get', {
    method: 'GET',
    ...(options || {}),
  });
}
// 批量设置通知为已读
export async function batchSetNotificationToRead(params) {
  return request('/api/Notification/BatchSetToRead', {
    method: 'PUT',
    data: { ...params },
  });
}
// 设置通知为已读
export async function setNotificationToRead(params) {
  return request('/api/Notification/SetToRead', {
    method: 'PUT',
    data: { ...params },
  });
}

// 批量设置消息为已读
export async function batchSetMessageToRead(params) {
  return request('/api/Message/BatchSetToRead', {
    method: 'PUT',
    data: { ...params },
  });
}
// 设置消息为已读
export async function setMessageToRead(params) {
  return request('/api/Message/SetToRead', {
    method: 'PUT',
    data: { ...params },
  });
}

// 批量设置待办事件为已读
export async function batchSetTodoEventToRead(params) {
  return request('/api/TodoEvent/BatchSetToRead', {
    method: 'PUT',
    data: { ...params },
  });
}
// 设置待办事件为已读
export async function setTodoEventToRead(params) {
  return request('/api/TodoEvent/SetToRead', {
    method: 'PUT',
    data: { ...params },
  });
}
// 读取未读消息
export async function getUnreadNoticeTotalCount(options) {
  return request('/api/Notice/GetUnreadNoticeTotalCount', {
    method: 'GET',
    ...(options || {}),
  });
}
/** 获取规则列表 GET /api/rule */

export async function rule(params, options) {
  return request('/api/rule', {
    method: 'GET',
    params: { ...params },
    ...(options || {}),
  });
}
/** 新建规则 PUT /api/rule */

export async function updateRule(options) {
  return request('/api/rule', {
    method: 'PUT',
    ...(options || {}),
  });
}
/** 新建规则 POST /api/rule */

export async function addRule(options) {
  return request('/api/rule', {
    method: 'POST',
    ...(options || {}),
  });
}
/** 删除规则 DELETE /api/rule */

export async function removeRule(options) {
  return request('/api/rule', {
    method: 'DELETE',
    ...(options || {}),
  });
}
